<html>

<head>
  <title></title>
</head>

<body>

<?php
$n =24;
for ($i=1; $i<$n; $i++) {
if($i == 1){$hour = '12:00 am'; $shour = 12; $s_ampm == 0; }
if($i == 2){$hour = '1:00'; $shour = 1; $s_ampm == 0; }
if($i == 3){$hour = '2:00'; $shour = 2; $s_ampm == 0; }
if($i == 4){$hour = '3:00'; $shour = 3; $s_ampm == 0; }
if($i == 5){$hour = '4:00'; $shour = 4; $s_ampm == 0; }
if($i == 6){$hour = '5:00'; $shour = 5; $s_ampm == 0; }
if($i == 7){$hour = '6:00'; $shour = 6; $s_ampm == 0; }
if($i == 8){$hour = '7:00'; $shour = 7; $s_ampm == 0; }
if($i == 9){$hour = '8:00'; $shour = 8; $s_ampm == 0; }
if($i == 10){$hour = '9:00'; $shour = 9; $s_ampm == 0; }
if($i == 11){$hour = '10:00'; $shour = 10; $s_ampm == 0; }
if($i == 12){$hour = '11:00'; $shour = 11; $s_ampm == 0; }
if($i == 13){$hour = '12:00 pm'; $shour = 12; $s_ampm == 1; }
if($i == 14){$hour = '1:00'; $shour = 1; $s_ampm == 1; }
if($i == 15){$hour = '2:00'; $shour = 2; $s_ampm == 1; }
if($i == 16){$hour = '3:00'; $shour = 3; $s_ampm == 1; }
if($i == 17){$hour = '4:00'; $shour = 4; $s_ampm == 1; }
if($i == 18){$hour = '5:00'; $shour = 5; $s_ampm == 1; }
if($i == 19){$hour = '6:00'; $shour = 6; $s_ampm == 1; }
if($i == 20){$hour = '7:00'; $shour = 7; $s_ampm == 1; }
if($i == 21){$hour = '8:00'; $shour = 8; $s_ampm == 1; }
if($i == 22){$hour = '9:00'; $shour = 9; $s_ampm == 1; }
if($i == 23){$hour = '10:00'; $shour = 10; $s_ampm == 1; }
if($i == 24){$hour = '11:00'; $shour = 11; $s_ampm == 1; }


	if ($shour == 0 && $sminute == 0 && $s_ampm == 0) {
		$starttime = "55:55:55";
	} else {
		if ($s_ampm == 1 && $shour != 12) $shour = $shour + 12;
		if ($s_ampm == 0 && $shour == 12) $shour = 0;
		$starttime = "$shour:$sminute:00";
	}
 $eventdata = getEventDataTimeArray($month, $year,$starttime);

 				$eventcount = count($eventdata[$day]["title"]);
				if (MAX_TITLES_DISPLAYED < $eventcount) $eventcount = MAX_TITLES_DISPLAYED;

				// write title link if posting exists for day
				for($j=0;$j < $eventcount;$j++) {
					$str .= "<span class=\"title_txt\">-";
					$str .= "<a href=\"javascript:openPosting(" . $eventdata[$day]["id"][$j] . ")\">";
					$str .= $eventdata[$day]["title"][$j] . "</a></span>" . $eventdata[$day]["timestr"][$j];
				}




echo '<tr>
    <td width="25%" rowspan="2">' . $hour . '</td>
    <td width="51%">&nbsp;</td>
    <td width="24%">' . $str . '</td>
  </tr>
  <tr>
    <td width="51%">&nbsp;</td>
    <td width="24%">&nbsp;</td>
</tr>';

 }


?>

</body>

</html>